package com.shortlink.common.constant;

/**
 * Redis Key 常量类
 *
 * @author wp
 */
public class RedisKeyConstant {
    /**
     * 计数限流器 Key
     */
    public static final String COUNT_RATE_LIMITER_KEY = "count:rate:limiter:%s";
    /**
     * 用户名布隆过滤器
     */
    public static final String USERNAME_BLOOM_KEY = "short-link:user:username:bloom";
    /**
     * 域名短链接布隆过滤器 Key
     */
    public static final String DOMAIN_SHORT_URI_BLOOM_KEY = "short-link:shortlink:shortUri:bloom:%s";
    /**
     * 用户注册分布式锁
     */
    public static final String LOCK_USER_REGISTER_KEY = "short-link:user:register:lock:%s";
    /**
     * 用户注册分布式ID
     */
    public static final String USER_ID_GENERATOR_KEY = "short-link:user:register:id";
    /**
     * 分组创建分布式ID
     */
    public static final String GROUP_ID_GENERATOR_KEY = "short-link:group:create:id";
    /**
     * 短链接发号器 Key
     */
    public static final String SHORT_URI_NUMBER_GENERATOR_KEY = "short-link:shortlink:shortUri:number:%s";
    /**
     * 短链接创建分布式ID
     */
    public static final String SHORT_LINK_ID_GENERATOR_KEY = "short-link:shortlink:create:id";
    /**
     * 短链接映射 Key
     */
    public static final String SHORT_LINK_MAPPER_KEY = "short-link:shortlink:mapper:%s:%s";
    /**
     * 短链接映射创建 TTL
     */
    public static final Long SHORT_LINK_MAPPER_CREATE_TTL = 30L;
    /**
     * 短链接映射 TTL
     */
    public static final Long SHORT_LINK_MAPPER_TTL = 30L;
    /**
     * 短链接映射为空 Key
     */
    public static final String NULL_SHORT_LINK_MAPPER_KEY = "short-link:shortlink:mapper:null:%s:%s";
    /**
     * 短链接映射为空 Value
     */
    public static final String NULL_SHORT_LINK_MAPPER_VALUE = "-";
    /**
     * 短链接映射为空 TTL
     */
    public static final Long NULL_SHORT_LINK_MAPPER_TTL = 2L;
    /**
     * 短链接跳转锁 Key
     */
    public static final String LOCK_SHORT_LINK_MAPPER_KEY = "short-link:shortlink:mapper:lock:%s:%s";
}
